package com.etime.util;

import java.io.FileWriter;

import java.io.IOException;
/* *
*类名：AlipayConfig
*功能：基础配置类
*详细：设置帐户有关信息及返回路径
*修改日期：2017-04-05
*说明：
*以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并
非一定要使用该代码。
*该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
*/
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000128623369";
    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key =
            "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCgadKwUe4gI9vhDfSPShzJssTeP+JjCMeanRr1VULsp+473gcP5Zza55dNcSNXoJnZjbtfTcNKJ0jvJ4rU6IASbbzR4iurFizZY/5zPsGC96U38MAV2i8n+ajI0VdfNJZ2/dnHviVk9cIPqwhKGevqYQmcPHy5JMCvBGMPP85We9s5yk8sqCN4irg3JnrkYhvc2CbsFrSEXSwaZUAuniwd3qGf6W8B8n8hrLCrQChf8d6mF7lBCVQtK6XEwfNN65ZjBvnxw15MOpOly+jcoMqjRAyrpZ67aRh5MIzwH50qYlfB2HMFVdhJ1TVuZ3HfXBsWbgF2Qq8apUxFaQilNa2FAgMBAAECggEBAI6japAUWjzEBgmJojQjv5NuXfYOMlzDetG17znFldvfu0wKspblImPYWMao2rdZfFRh3gHxoLx4UDcwHxgQoYlBgQvUI+ZesoSfkKujWuj9EjG65uLHfvT536ap1xo2JbErKpKdNp0elm/eMmHJyOhBXw1JD9KFprw5l2gA4ZYt4/GpGdLne5sXOHuXUJG1PE07vNIBJKWhVD7VjerOZzoluvebiPxAbuJNshLIa0JEOy7aUj7ImHsjfvysvxHC13N9OEh7g9sr5v/Xvq1lQ/HzTv8hii6deYk71qo7SA8i9ehElMaAEP/robwBoAmPm0mB7I0SpB0eMH1PR24fqkUCgYEA35A3tJw1O1QVFgiSVfA9974ws5VcItY9AvGvTkbwX266Y5+ESlF09HWPQAQC0lWWP4C9O1X6ufj45bdFXkeH5TYmfm7OsyrL3g8H8FpmyiWWbIUsDlTBdCzw982fBitXAyxmmqE3f6IpQhMJJi3sS1xrktKS9iX8ZxBH4xoksnMCgYEAt7AI1pk2Iv4Q1Z2YHElINjC6AZWH4DN2A1W7Dze4wWVthU6BEjjqnS94i0kk/7c4CWOu27q/kT9wn+L7Q17mNeTi7Qtsj01zdjZ2zThFcbAZfHx8m2VaBZcRVFjW0EvXi8NGPHMECf6ebRropuLGlPl+5dVudtRYAUkBF6NCCicCgYBnkM+9g3/FdDYwdtgTp6+NTTYSe2arXMP20S98+6/vBcSi0grews2DUdKCvVjxR2TLFkCTdEkqTgQ/pp8kBc8Wh/ddKsfmiDTZMe1jkv17N95vd2HpYaocv5UBtuesW/d7KN5/U5/6KI0kZt0eKrgEUVQkOBiMnxxGQmyK8Fl/sQKBgFynvS2Shw5Lne5C2lGaXYSIO6tE5A8hpiu0ePEKKHXVVdNicBTjBOVY5rNLqBAdOXTzBWbs4mi/2W2tLxUir3kMBbOQiagXZ2B/xJlsAwt/yrtSiABStYAQXbtwPJtBRm7Hh4xCcA0ilINwiV51Ebpfx7TjXh8uqV2sl5J21X8NAoGAOteSjcpDf92jRzAp1jq9xtkRiE+ddapFlJwglOlVQfYg1A+79akhBLwZRYKr72wdGCGVzdsXdIes1F7igsvJ/QisKfrwJaa5IjG9eLId71qsj0wVtZH9nbocUVK3JqgiXiD7+0HVFkVY9G55LgoMgkzsyPD05T9dGwBGihIUsLQ=";
// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key =
            "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiT1XdcTMBLle3mZiMuWfF+nAGncrX2y9OSetNJ41RvKXT3cdaPoaDINEovEZYLmjl7t4dDJSqNrsZH4r5T79UinN4pshMsC7X7L/CbpcjbswXebW0kdgv6rAR7kLePILDQIBAfgGgefMtSjmJ9XHDAVIDLQn5wRALLI9hjtwcmQ+hjdx2SIyx5JuKEzPQ2dYbDCjVqv06zOv8uXz88HMbLzEZj3o0+ZjfPJubnIjcJdFR7V9JQdckQ54o9Iap1KkmMoyB40dI7WdGzvLkfRMvw8kE5X+SteFev/Zd75DNPapR1o78IyCgYLmv4rB7R1gU268IDN588JI/HLAMVd/GQIDAQAB";
// 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
    // 支付宝网关
    public static String log_path = "C:\\";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" +
                    System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
